package com.hzw.saas.api.msg.enums;

/**
 * <p>
 * 消息状态
 * </p>
 *
 * @author sonam
 * @since 2020/12/26 16:36
 */
public enum MsgRead {

    UNREAD(0,"未读"),
    READ(1,"已读");
    /**
     * 状态代号
     */
    private final int code;

    /**
     * 状态文本
     */
    private final String text;

    MsgRead(int code, String text) {
        this.code = code;
        this.text = text;
    }

    public int code() {
        return code;
    }

    public String text() {
        return text;
    }

    public static MsgRead instance(int code) {
        for (MsgRead value : values()) {
            if (value.code() == code) {
                return value;
            }
        }
        return null;
    }
}

